{include file="public/head"/}
  
  <body>
    <div class="x-body">
        <form class="layui-form" action="#" method="post" enctype="multipart/form-data">
            <input type="hidden" name="id"  value="{$info.id}" />
            <div class="layui-form-item">
                <label for="username" class="layui-form-label">
                    <span class="x-red">*</span>商户名称:
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="username" name="merchant_name" required="" lay-verify="required"
                    autocomplete="off" class="layui-input"  style="width: 300px;" value="{$info.merchant_name}">
                </div>
            </div>

            <div class="layui-form-item">
                <label for="username" class="layui-form-label">
                    <span class="x-red">*</span>服务商:
                </label>
                <div class="layui-input-inline" style="width: 300px;">
                    <select name="service_id">
                        <option value="">选择服务商</option>
                        {foreach $service as $ser}
                        <option value="{$ser.id}" {if $info.service_id == $ser.id} selected="selected" {/if}>{$ser.name}</option>
                        {/foreach}
                    </select>
                </div>
            </div>

            <div class="layui-form-item">
                <label for="username" class="layui-form-label">
                    <span class="x-red">*</span>客服电话:
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="username" name="merchant_service_phone" required="" lay-verify="required"
                    autocomplete="off" class="layui-input"  style="width: 300px;" value="{$info.merchant_service_phone}">
                </div>
            </div>

            <div class="layui-form-item">
                <label for="username" class="layui-form-label">
                    <span class="x-red">*</span>签约账号:
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="username" name="account_no" required="" lay-verify="required"
                    autocomplete="off" class="layui-input" style="width:300px;" value="{$info.account_no}">
                </div>
            </div>

            <div class="layui-form-item">
                <label for="username" class="layui-form-label">
                    <span class="x-red">*</span>授权token:
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="username" name="accredit" required="" lay-verify="required"
                    autocomplete="off" class="layui-input" style="width:300px;" value="{$info.accredit}">
                </div>
            </div>

            <div class="layui-form-item">
                <label for="username" class="layui-form-label">
                    <span class="x-red">*</span>商户ID:
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="username" name="agent_id" required="" lay-verify="required"
                    autocomplete="off" class="layui-input" style="width:300px;" value="{$info.agent_id}">
                </div>
            </div>

            <div class="layui-form-item">
                <label for="username" class="layui-form-label">
                    <span class="x-red">*</span>收款ID:
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="username" name="mchnt_id" required="" lay-verify="required"
                    autocomplete="off" class="layui-input" style="width:300px;" value="{$info.mchnt_id}">
                </div>
            </div>

           

            <!--<div class="layui-form-item">
                <label for="L_username" class="layui-form-label">
                    <span class="x-red"></span>上传logo:
                </label>
                <div class="layui-input-inline">
                    <input type="file" id="L_username" name="merchant_logo" style="width:300px;">
                </div>
            </div>-->

            <div class="layui-form-item">
                <label for="L_repass" class="layui-form-label">
                </label>
                <button  class="layui-btn" lay-filter="add" lay-submit="">
                    修改商户
                </button>
            </div>
        </form>
    </div>
<script type="text/javascript">
    //下面用于多图片上传预览功能
    function setImagePreviews(avalue) {
        var docObj = document.getElementById("doc");
        var dd = document.getElementById("dd");
        dd.innerHTML = "";
        var fileList = docObj.files;
        for (var i = 0; i < fileList.length; i++) {
            dd.innerHTML += "<div style='float:left' > <img id='img" + i + "'  /> </div>";
            var imgObjPreview = document.getElementById("img"+i); 
            if (docObj.files && docObj.files[i]) {
                //火狐下，直接设img属性
                imgObjPreview.style.display = 'block';
                imgObjPreview.style.width = '150px';
                imgObjPreview.style.height = '180px';
                //imgObjPreview.src = docObj.files[0].getAsDataURL();
                //火狐7以上版本不能用上面的getAsDataURL()方式获取，需要一下方式
                imgObjPreview.src = window.URL.createObjectURL(docObj.files[i]);
            }else {
                //IE下，使用滤镜
                docObj.select();
                var imgSrc = document.selection.createRange().text;
                alert(imgSrc)
                var localImagId = document.getElementById("img" + i);
                //必须设置初始大小
                localImagId.style.width = "150px";
                localImagId.style.height = "180px";
                //图片异常的捕捉，防止用户修改后缀来伪造图片
                try{
                    localImagId.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale)";
                    localImagId.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = imgSrc;
                }catch(e){
                    alert("您上传的图片格式不正确，请重新选择!");
                    return false;
                }
                imgObjPreview.style.display = 'none';
                document.selection.empty();
            }
        }
        return true;
    }
</script>

    <script>
        var _hmt = _hmt || []; (function() {
            var hm = document.createElement("script");
            hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(hm, s);
        })();
    </script>
    </body>
</html>